#include <bits/stdc++.h>
using namespace std;

class Solution
{
public:
    int main()
    {
        string line;
        cin >> line;
        int n = line.size();
        cout << n << " ";
        int lastNum = 0;
        int count = 0;
        do
        {
            for (char c : line)
            {
                if (c == lastNum + '0')
                {
                    ++count;
                }
                else
                {
                    cout << count << " ";
                    count = 1;
                    lastNum = !lastNum;
                }
            }
            cin >> line;
            --n;
        } while (n > 0);
        cout << count;
        return 0;
    }
};

#ifndef __LOCAL_TEST__
int main()
{
    return Solution().main();
}
#endif